<!DOCTYPE html>
<html lang="cmn-Hans" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>发送消息</title>
    <link rel="stylesheet" th:href="@{/frame/layui/css/layui.css}">
</head>
<body>
<textarea id="mymsg" style="display: none;"></textarea>
<button class="layui-btn layui-btn-fluid layui-btn-normal" onclick="doSend()">发送消息</button>
<script th:src="@{/frame/layui/layui.js}"></script>
<script>
    let self;
    let other;
    layui.use(['layedit','layer'], function(){
        const layedit = layui.layedit;
        const $ = layui.$;
        const xxx = layedit.build('mymsg');
        window.doSend=function () {
            $.post('[[@{/message/sendToOther}]]',{'receiver.phone':other,content: layedit.getContent(xxx)},function (res) {
                parent.layer.msg('消息已经送达！',{icon:1,time:2000});
                const index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            });
        }
    });
    function deliverValue(b) {
        other=b;
    }
</script>
</body>
</html>